Skip to content

Instantly share code, notes, and snippets.

@donpandix
donpandix / valida_rut.js
Last active May 21, 2024 17:34
Valida RUT chileno con JavaScript
var Fn = {
// Valida el rut con su cadena completa "XXXXXXXX-X"
validaRut : function (rutCompleto) {
if (!/^[0-9]+[-|‐]{1}[0-9kK]{1}$/.test( rutCompleto ))
return false;
var tmp = rutCompleto.split('-');
var digv = tmp[1];
var rut = tmp[0];
if ( digv == 'K' ) digv = 'k' ;
return (Fn.dv(rut) == digv );
@Ravarcheon
Ravarcheon / spectralRotation.py
Last active May 21, 2024 17:33
rotates an audio file by 90 degrees in the spectrum while being a reversible process with minimal loss (only floating point errors which are like -150 dB but thats literally silence ahaha~)
import numpy as np
import soundfile as sf
from scipy.fftpack import fft, ifft
def rotateSignal(signal,flip):
if flip:
signal = signal[::-1]
x = np.concatenate((signal, signal[1:][::-1])) # concatenating the array with a reverse of itself makes it such that the fourier transform doesn't layer over a reversed version of itself in the inverse fft
rotSig = ifft(x)
Roblox.Hack = {
original: 'missingno',
balance: 0,
initialized: 0,
loading: false,
items: [],
inventoryString: '<li class="list-item item-card ng-scope"><div class="item-card-container"><a class="item-card-link" href="%1" data-ytta-id="-"><div class="item-card-thumb-container"><div ng-hide="item.Product.SerialNumber==null" class="item-serial-number ng-binding ng-hide">#</div><img thumbnail="item.Thumbnail" image-retry="" class="item-card-thumb ng-isolate-scope" src="%2"></div><div class="text-overflow item-card-name ng-binding" title="%6 ">%6 </div></a><!-- ngIf: item.Item.AudioUrl --><div class="text-overflow item-card-creator"><span class="xsmall text-label">By</span> <a class="xsmall text-overflow text-link ng-binding" ng-href="%3" ng-hide="assetsListContent.assetItems.data.Data.PageType!==\'favorites\'&amp;&amp;currentData.category.name==\'Places\'&amp;&amp;(currentData.subcategory.name==\'My VIP Servers\'||currentData.subcategory.name==\'Other VIP Servers\')&amp;&amp;staticData.isOwnPage" href="%3"
@olivia3215
olivia3215 / instructions.md
Last active May 21, 2024 17:32
Instructions for importing a Dreamhost mail drop into gmail

Using a Dreamhost mailbox from gmail

To those with mailboxes on Dreamhost, such as on our domain cindysworld.org, these instructions will be helpful in using your mailbox from gmail. If you are hosted on another domain, just replace cindysworld.org with your domain in the following instructions.

Changing your password

Every email user can log into https://mailboxes.dreamhost.com/ with their full email and current password. Once logged in, they can reset the password. If the user does not remember the current password, they must contact the account manager.

@wojteklu
wojteklu / clean_code.md
Last active May 21, 2024 17:31
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@rphlmr
rphlmr / helpers.ts
Last active May 21, 2024 17:30
Drizzle ORM, deep sub queries
/* -------------------------------------------------------------------------- */
/* More here; */
/* -------------------------------------------------------------------------- */
//gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15
https: export function distinctOn<Column extends AnyColumn>(column: Column) {
return sql<Column["_"]["data"]>`distinct on (${column}) ${column}`;
}
export function jsonBuildObject<T extends SelectedFields>(shape: T) {
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 21, 2024 17:30
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@trngbich
trngbich / Merge_Zotero_duplicates
Last active May 21, 2024 17:29
merge duplicates in Zotero. Open Zotero > select 'Duplicate Items' > select first item > select first version > Open 'Developer/Run Javascript' > copy and paste > Run. Source: https://forums.zotero.org/discussion/40457/merge-all-duplicates.
// By: marcelparciak
var DupPane = Zotero.getZoteroPanes();
for(var i = 0; i < 100; i++) {
await new Promise(r => setTimeout(r, 1000));
DupPane[0].mergeSelectedItems();
Zotero_Duplicates_Pane.merge();
}
@leeuwd
leeuwd / setup-ubuntu-akeneo-pim.md
Last active May 21, 2024 17:29
How to setup an Ubuntu server (i.e. DigitalOcean LAMP stack droplet) Akeneo PIM server.

How to setup the Akeneo server

# date: january 2018
# author: Dick de Leeuw (dick@leeuw.studio, @leeuwd)
# prerequisites: LAMP droplet (>= 8GB RAM)
# environment: Ubuntu 16.04.3 LTS xenial, Apache/2.4.29 (Ubuntu), MySQL 5.7.21 & PHP 7.1

# create droplet